package zero.tech.games.dn.data.entity;

public class Card {
	
	private int cardId;
	private int cardNum;// 3-13 A 14 2 15 小王 16 大王 17
	private int cardColor;//6大王 5小王 4黑桃 3红桃 2梅花1方块

	public Card(int color, int num) {
		cardNum = num;
		cardColor = color;
		cardId = color*100+num;
	}

	public int getCardId() {
		return cardId;
	}

	public void setCardId(int cardId) {
		this.cardId = cardId;
	}

	public int getCardNum() {
		return cardNum;
	}

	public void setCardNum(int cardNum) {
		this.cardNum = cardNum;
	}

	public int getCardColor() {
		return cardColor;
	}

	public void setCardColor(int cardColor) {
		this.cardColor = cardColor;
	}

	@Override
	public String toString() {
		return "Card [cardId=" + cardId + "]";
	}

	public static Card parse(int cardId) {
		int num=cardId%100;
		int color=cardId/100;
		return new Card(color, num);
	}



}
